Add Stalled condition and top level observedGeneration - #7664
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #7664 +/- ##
==========================================
+ Coverage 82.34% 82.44% +0.09%
==========================================
Files 130 131 +1
Lines 15879 15901 +22
==========================================
+ Hits 13076 13109 +33
+ Misses 2516 2506 -10
+ Partials 287 286 -1
🚀 New features to boost your workflow:
|
3041492 to
dbe1918
Compare
Signed-off-by: Tero Saarni <tero.saarni@est.tech>
|
I'm pretty confident about status reporting now being correctly interpreted, because this PR uses the actual I think it is common use case that user deploys
Previously in step (2) Helm did not know how to interpret status conditions in |
|
@deepy since you work with Helm, do you have any insights or opinions on this PR and my question: #7664 (comment). No worries if you are too busy. |
|
I'll take a look tonight 👍 |
|
For people who use Helm through Flux the given scenario is likely not going to be an issue since depending on how you package your app you'll likely have the TLS secret created at the same time as the But for the scenario where that's not the case, or where you have other resources that don't have a status that Flux understands then it might get interesting, the immediate scenario that comes to mind is a chart with a So while this is easy in Flux (even if it's a bit awkward), for Helm users I don't think there's really any way to solve it. At least until hip-0025 gets implemented, which solves exactly this scenario |
|
Thank you @deepy! Yes I was also thinking the exact cert-manager scenario. Imagine an umbrella chart with both contour and cert-manager, then run |
|
I have now tested this with helm v4.2.4. I created a chart with an apiVersion: projectcontour.io/v1
kind: HTTPProxy
metadata:
name: test-proxy
spec:
virtualhost:
fqdn: test.example.com
tls:
secretName: missing-tls-secret
routes:
- services:
- name: echoserver
port: 80The The results are:
Additionally, we cannot change the semantics of the If speculating that there was a Helm-specific way to signal status exclusively to Helm, then it might be possible to synthesize a new status meant only as a success criteria for the installation, rather than indicating overall resource status. This would still raise the question which errors are acceptable and should be ignored for deployment purposes, and the answer might not be the same for every user. That said, kstatus is clearly a generic status library, not Helm-specific. So I'm starting to think it is not good idea to implement, at least not for Helm |
|
There's also positive scenarios where it does make sense to implement it for Helm's Maybe a bit contrived of an example but: say you have 2 steps, the first one deploys the certificate + other supporting infrastructure and the second one deploys your app |
True. So, it depends entirely on the deployment design if errors are to be expected. With quick browsing, it seems that Flux allows more flexibility in defining what exact resources are checked for health, and what exact condition to check, while I cannot see anything in Helm for this. There it seems to be all-or-nothing. |
This PR adds following
Stalledis written toHTTPProxy.status.conditionsandExtensionService.status.conditionsHTTPProxy.status.observedGenerationandExtensionService.status.observedGenerationwere addedThese are needed when client uses
sigs.k8s.io/cli-utils/pkg/kstatus/statuslibrary to derive a single value that represents the status ofHTTPProxyorExtensionServiceresource.The logic is explained at https://github.com/kubernetes-sigs/cli-utils/tree/master/pkg/kstatus. No common specification exists to determine if a resource has successfully reconciled. For example,
HTTPProxyusesValidcondition, while some projects use aReadycondition. The kstatus library defines two recommended conditions:ReconcilingandStalled. This PR adopts only theStalledcondition.The library will determine status in following way:
observedGeneration < generationthen the library returnsInProgress(src link)Stalled: Truethe library returnsFailed(src link)Current(src link)Besides these, the library returns status
Terminatingwhenmetadata.deletionTimestampis set by the Kubernetes API server.This PR adds
kstatuslibrary as a test dependency to verify that expected status is reported forHTTPProxyin different scenarios. Clients that use kstatus include Helm4 and FluxCD. Both use a fork of the library (link) but behaviour should be the same.Downgrade note: older Contour releases do not support the
Stalledstatus condition and cannot remove condition set by newer Contour version after a downgrade. This condition must be removed manually to prevent incorrect status reporting by kstatus clients.Fixes #7670
This PR replaces #7648